package com.abing.sandbox.config;

import com.abing.sandbox.CodeSandbox;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author CaptainBing
 * @Date 2024/9/14 10:40
 * @Description
 */
@Configuration
@EnableConfigurationProperties(CodeSandboxProperties.class)
@RequiredArgsConstructor
public class CodeSandboxConfiguration {

    @Bean
    public CodeSandbox codeSandbox(CodeSandboxProperties codeSandboxProperties){
        return CodeSandbox.newInstance(codeSandboxProperties.getMode());
    }

}
